<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>北京联合大学</title>
</head>
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://at.alicdn.com/t/font_835526_uzbxo9d25is.css">
<link rel="stylesheet" href="../../css/Initialization.css">
<link rel="stylesheet" href="../../css/commen.css">
<link rel="stylesheet" href="../../css/woker111.css">
<link rel="stylesheet" href="../../css/unit.css">
<body>
<div id="content">
    <div class="initer">
            <!-- 具体内容 -->
            <div class="bread">
                <div class="plain" th:text="${menu.menuname}">成立公司</div>
                <div class="plain">
                    <i class="iconfont icon-right"></i>
                </div>
                <div class="plain current" th:text="${smenu.menuname}">单元知识点</div>
                <div class="center-button" style="margin-right: 120px;" th:if="${personType == 1 && smenu.id+'' == '201911151263870008'}" >
                    <a th:href="@{/function/content/basicslist(mid=${menu.id},sid=${smenu.id},gradeid=${gradeid},gotype=1)}"><span>预览</span></a>
                </div>
                <div class="center-button" th:if="${personType == 1}">
                    <a th:href="@{/function/content/addContent(mid=${menu.id},sid=${smenu.id},gradeid=${gradeid})}"><span>新建</span><i class="iconfont icon-jia1"></i></a>
                </div>
            </div>
            <div class="list task">
                <ul>
                    <li th:each="item : ${pageResult.list}">
                        <i class="icon-dian iconfont"></i>
                        <span th:text="${#strings.abbreviate(item.title,55)}" th:alt="${item.title}">成立公司课程知识点内容</span>

                        <div class="row" th:if="${personType == 1}">
                            <span class="min-button r20" th:onclick="'javascript:updateCon(\''+${item.id}+'\')'">编辑</span>
                            <span class="min-button" th:onclick="'javascript:deleteCon(\''+${item.id}+'\')'">删除</span>
                        </div>

                        <span class="row" th:if="${personType == 2}"><i class="icon-right iconfont"></i></span>
                        <a th:href="@{/function/content/detail(id=${item.id})}" th:if="${personType == 2}">跳转到单元知识点详情</a>
                    </li>
                </ul>
            </div>
            <!-- 分页 -->
            <div class="pages" th:utext="${pageResult.getPageHtml()}"></div>
        </div>
</div>
<script src="../../js/jquery-3.4.1.min.js"></script>
<script src="../../js/commen.js"></script>
<script>
    function deleteCon(id) {
        if(confirm("是否确定删除")){
            $.ajax({
                type : "POST",
                url : "delete",
                data : {id: id},
                dataType : "json",
                success : function(json) {
                    alert(json.result);
                    if(json.state == success){
                        location.reload();
                    }
                },
                error:function(msg){
                    alert("程序出错，请联系管理员");
                }
            });
        }
    }

    function updateCon(id) {
        location.href = "update?id="+id;
    }
</script>
</body>
</html>


